<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>octant.cf</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="octant-module.html">Package&nbsp;octant</a> ::
        Module&nbsp;cf
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="octant.cf-module.html">Module octant.cf</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># encoding: utf-8</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-docstring">"""</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">cf.py - classes around CF compliant files</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring">The cf module is made for reading CF-compliant datasets,</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">knowing data, its structure, units and conversions</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring">between units afterwards.</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-docstring">Dependencies:</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-docstring">=============</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring">numpy</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring">netcdftime (packaged in netcdf4-python)</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-name">__docformat__</tt> <tt class="py-op">=</tt> <tt class="py-string">"restructuredtext en"</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">numpy</tt> <tt class="py-keyword">as</tt> <tt class="py-name">np</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">netcdftime</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Package octant=octant-module.html"><a title="octant" class="py-name" href="#" onclick="return doclink('link-0', 'octant', 'link-0');">octant</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module octant.io=octant.io-module.html"><a title="octant.io" class="py-name" href="#" onclick="return doclink('link-1', 'io', 'link-1');">io</a></tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"> </tt>
<a name="time"></a><div id="time-def"><a name="L22"></a><tt class="py-lineno"> 22</tt> <a class="py-toggle" href="#" id="time-toggle" onclick="return toggle('time');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="octant.cf.time-class.html">time</a> <tt class="py-op">(</tt><tt class="py-base-class">np</tt><tt class="py-op">.</tt><tt class="py-base-class">ndarray</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="time-expanded"><a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line">    <tt class="py-docstring">"""Return time object from netCDF file</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">    Parameters</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">    ----------</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">    nc : netCDF3/4 object or filename</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">        Time information will be read from this netCDF3/4 file.</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">    name : string, optional</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">        The name of the the variable.</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">    units : string, optional</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">        The name of the variable units.</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">    calendar : string, optional</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">        A string representing the calandar to use. See netcdftime</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">        documentation for possible values.</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">    Returns</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    -------</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">    nctime : ndarray</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">        A subclass of numpy.ndarray with values equal to the time variable in</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">        the netCDF file referenced with nc.</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">     </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">    <tt id="link-2" class="py-name" targets="Variable octant.cf.time._unit2sec=octant.cf.time-class.html#_unit2sec,Variable octant.ocean.time.time._unit2sec=octant.ocean.time.time-class.html#_unit2sec"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-2', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'seconds'</tt> <tt class="py-op">:</tt> <tt class="py-number">1.0</tt><tt class="py-op">,</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">               <tt class="py-string">'minutes'</tt> <tt class="py-op">:</tt> <tt class="py-number">60.0</tt><tt class="py-op">,</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">               <tt class="py-string">'hours'</tt>   <tt class="py-op">:</tt> <tt class="py-number">3600.0</tt><tt class="py-op">,</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">               <tt class="py-string">'days'</tt>    <tt class="py-op">:</tt> <tt class="py-number">3600.0</tt><tt class="py-op">*</tt><tt class="py-number">24.0</tt><tt class="py-op">,</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">               <tt class="py-string">'weeks'</tt>   <tt class="py-op">:</tt> <tt class="py-number">3600.0</tt><tt class="py-op">*</tt><tt class="py-number">24.0</tt><tt class="py-op">*</tt><tt class="py-number">7.0</tt><tt class="py-op">,</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">               <tt class="py-string">'years'</tt>   <tt class="py-op">:</tt> <tt class="py-number">3600.0</tt><tt class="py-op">*</tt><tt class="py-number">24.0</tt><tt class="py-op">*</tt><tt class="py-number">365.242198781</tt><tt class="py-op">}</tt> <tt class="py-comment">#ref to udunits</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">    <tt id="link-3" class="py-name" targets="Variable octant.cf.time._sec2unit=octant.cf.time-class.html#_sec2unit,Variable octant.ocean.time.time._sec2unit=octant.ocean.time.time-class.html#_sec2unit"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-3', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'seconds'</tt> <tt class="py-op">:</tt> <tt class="py-number">1.0</tt><tt class="py-op">,</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">               <tt class="py-string">'minutes'</tt> <tt class="py-op">:</tt> <tt class="py-number">1.0</tt><tt class="py-op">/</tt><tt class="py-number">60.0</tt><tt class="py-op">,</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">               <tt class="py-string">'hours'</tt>   <tt class="py-op">:</tt> <tt class="py-number">1.0</tt><tt class="py-op">/</tt><tt class="py-number">3600.0</tt><tt class="py-op">,</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">               <tt class="py-string">'days'</tt>    <tt class="py-op">:</tt> <tt class="py-number">1.0</tt><tt class="py-op">/</tt><tt class="py-op">(</tt><tt class="py-number">24.0</tt><tt class="py-op">*</tt><tt class="py-number">3600.0</tt><tt class="py-op">)</tt><tt class="py-op">}</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"> </tt>
<a name="time.__new__"></a><div id="time.__new__-def"><a name="L57"></a><tt class="py-lineno"> 57</tt> <a class="py-toggle" href="#" id="time.__new__-toggle" onclick="return toggle('time.__new__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#__new__">__new__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">ncfile</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-string">'time'</tt><tt class="py-op">,</tt> <tt class="py-param">units</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">calendar</tt><tt class="py-op">=</tt><tt class="py-string">'standard'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.__new__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.__new__-expanded"><a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_nc</tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name"><a title="octant" class="py-name" href="#" onclick="return doclink('link-4', 'octant', 'link-0');">octant</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="octant.io" class="py-name" href="#" onclick="return doclink('link-5', 'io', 'link-1');">io</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Function octant.io.Dataset()=octant.io-module.html#Dataset"><a title="octant.io.Dataset" class="py-name" href="#" onclick="return doclink('link-6', 'Dataset', 'link-6');">Dataset</a></tt><tt class="py-op">(</tt><tt class="py-name">ncfile</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_nc</tt><tt class="py-op">.</tt><tt class="py-name">variables</tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">view</tt><tt class="py-op">(</tt><tt id="link-7" class="py-name" targets="Class octant.cf.time=octant.cf.time-class.html,Module octant.ocean.time=octant.ocean.time-module.html,Class octant.ocean.time.time=octant.ocean.time.time-class.html"><a title="octant.cf.time
octant.ocean.time
octant.ocean.time.time" class="py-name" href="#" onclick="return doclink('link-7', 'time', 'link-7');">time</a></tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">units</tt> <tt class="py-op">==</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">            <tt class="py-name">units</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_nc</tt><tt class="py-op">.</tt><tt class="py-name">variables</tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">units</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt> <tt class="py-op">=</tt> <tt class="py-name">netcdftime</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">(</tt><tt class="py-name">units</tt><tt class="py-op">,</tt> <tt class="py-name">calendar</tt><tt class="py-op">=</tt><tt class="py-name">calendar</tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">data</tt> </tt>
</div><a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">     </tt>
<a name="time.__array_finalize__"></a><div id="time.__array_finalize__-def"><a name="L66"></a><tt class="py-lineno"> 66</tt> <a class="py-toggle" href="#" id="time.__array_finalize__-toggle" onclick="return toggle('time.__array_finalize__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#__array_finalize__">__array_finalize__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">obj</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.__array_finalize__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.__array_finalize__-expanded"><a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">,</tt> <tt class="py-string">'utime'</tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
</div><a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">     </tt>
<a name="time.arg_nearest_date"></a><div id="time.arg_nearest_date-def"><a name="L69"></a><tt class="py-lineno"> 69</tt> <a class="py-toggle" href="#" id="time.arg_nearest_date-toggle" onclick="return toggle('time.arg_nearest_date');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#arg_nearest_date">arg_nearest_date</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dateo</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.arg_nearest_date-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.arg_nearest_date-expanded"><a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return index of date nearest to query date.</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">        Prameters</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">        ---------</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">        dateo : datetime object</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring">            The query date</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">        Returns</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">        -------</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">        idx : integer</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">            The index of the date closest to dateo. If two dates are</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">            equidistant, the smaller is returned.</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">to</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">date2num</tt><tt class="py-op">(</tt><tt class="py-name">dateo</tt><tt class="py-op">)</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> \ </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">                <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">     </tt>
<a name="time.nearest_date"></a><div id="time.nearest_date-def"><a name="L88"></a><tt class="py-lineno"> 88</tt> <a class="py-toggle" href="#" id="time.nearest_date-toggle" onclick="return toggle('time.nearest_date');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#nearest_date">nearest_date</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dateo</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.nearest_date-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.nearest_date-expanded"><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the nearest date to query date.</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">        Prameters</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">        ---------</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">        dateo : datetime object</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">            The query date</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">        Returns</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">        -------</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-docstring">        nearest_date : datetime object</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-docstring">            A datetime object of the date closest to dateo. If two dates are</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-docstring">            equidistant, the smaller is returned.</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-name">idx</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Variable octant.cf.time.dates=octant.cf.time-class.html#dates,Variable octant.ocean.time.time.dates=octant.ocean.time.time-class.html#dates"><a title="octant.cf.time.dates
octant.ocean.time.time.dates" class="py-name" href="#" onclick="return doclink('link-8', 'dates', 'link-8');">dates</a></tt><tt class="py-op">-</tt><tt class="py-name">dateo</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> \ </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">                <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="octant.cf.time.dates
octant.ocean.time.time.dates" class="py-name" href="#" onclick="return doclink('link-9', 'dates', 'link-8');">dates</a></tt><tt class="py-op">-</tt><tt class="py-name">dateo</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">idx</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">idx</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="octant.cf.time.dates
octant.ocean.time.time.dates" class="py-name" href="#" onclick="return doclink('link-10', 'dates', 'link-8');">dates</a></tt><tt class="py-op">[</tt><tt class="py-name">idx</tt><tt class="py-op">]</tt> </tt>
</div><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">     </tt>
<a name="time.arg_nearest"></a><div id="time.arg_nearest-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="time.arg_nearest-toggle" onclick="return toggle('time.arg_nearest');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#arg_nearest">arg_nearest</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">to</tt><tt class="py-op">,</tt> <tt class="py-param">units</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.arg_nearest-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.arg_nearest-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return index of time nearest to query time.</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">        Prameters</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">        ---------</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">        to : float</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">            The query time.</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-docstring">        units : string, optional</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-docstring">            The units of the reference time. Defaults to the reference time</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"><tt class="py-docstring">            string 'units' in the netcdf oject.</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"><tt class="py-docstring">        Returns</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"><tt class="py-docstring">        -------</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">        idx : integer</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"><tt class="py-docstring">            The index of the date closest to to. If two times are equidistant,</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt class="py-docstring">            the smaller is returned.</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">units</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">            <tt class="py-name">to</tt> <tt class="py-op">*=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-11', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-12', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">     </tt>
<a name="time.nearest"></a><div id="time.nearest-def"><a name="L130"></a><tt class="py-lineno">130</tt> <a class="py-toggle" href="#" id="time.nearest-toggle" onclick="return toggle('time.nearest');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#nearest">nearest</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">to</tt><tt class="py-op">,</tt> <tt class="py-param">units</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.nearest-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.nearest-expanded"><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return time nearest to time query.</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-docstring">        Prameters</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-docstring">        ---------</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">        to : float</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-docstring">            The query time.</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-docstring">        units : string, optional</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-docstring">            The units of the reference time. Defaults to the reference time</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-docstring">            string 'units' in the netcdf oject.</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"><tt class="py-docstring">        Returns</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line"><tt class="py-docstring">        -------</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line"><tt class="py-docstring">        idx : integer</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line"><tt class="py-docstring">            The index of the date closest to to. If two times are equidistant,</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"><tt class="py-docstring">            the smaller is returned.</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">units</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">            <tt class="py-name">to</tt> <tt class="py-op">*=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-13', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-14', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-name">idx</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">where</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">abs</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">-</tt><tt class="py-name">to</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">        <tt class="py-name">idx</tt> <tt class="py-op">=</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-name">idx</tt><tt class="py-op">)</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-name">idx</tt><tt class="py-op">]</tt> </tt>
</div><a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">     </tt>
<a name="time.get_seconds"></a><div id="time.get_seconds-def"><a name="L154"></a><tt class="py-lineno">154</tt> <a class="py-toggle" href="#" id="time.get_seconds-toggle" onclick="return toggle('time.get_seconds');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_seconds">get_seconds</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_seconds-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_seconds-expanded"><a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-name">fac</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-15', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-16', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-string">'seconds'</tt><tt class="py-op">]</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">*</tt><tt class="py-name">fac</tt> </tt>
</div><a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">     </tt>
<a name="time.get_minutes"></a><div id="time.get_minutes-def"><a name="L158"></a><tt class="py-lineno">158</tt> <a class="py-toggle" href="#" id="time.get_minutes-toggle" onclick="return toggle('time.get_minutes');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_minutes">get_minutes</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_minutes-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_minutes-expanded"><a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt class="py-name">fac</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-17', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-18', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-string">'minutes'</tt><tt class="py-op">]</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">*</tt><tt class="py-name">fac</tt> </tt>
</div><a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="time.get_hours"></a><div id="time.get_hours-def"><a name="L162"></a><tt class="py-lineno">162</tt> <a class="py-toggle" href="#" id="time.get_hours-toggle" onclick="return toggle('time.get_hours');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_hours">get_hours</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_hours-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_hours-expanded"><a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">        <tt class="py-name">fac</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-19', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-20', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-string">'hours'</tt><tt class="py-op">]</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">*</tt><tt class="py-name">fac</tt> </tt>
</div><a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">     </tt>
<a name="time.get_days"></a><div id="time.get_days-def"><a name="L166"></a><tt class="py-lineno">166</tt> <a class="py-toggle" href="#" id="time.get_days-toggle" onclick="return toggle('time.get_days');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_days">get_days</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_days-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_days-expanded"><a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt class="py-name">fac</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="octant.cf.time._unit2sec
octant.ocean.time.time._unit2sec" class="py-name" href="#" onclick="return doclink('link-21', '_unit2sec', 'link-2');">_unit2sec</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">units</tt><tt class="py-op">]</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="octant.cf.time._sec2unit
octant.ocean.time.time._sec2unit" class="py-name" href="#" onclick="return doclink('link-22', '_sec2unit', 'link-3');">_sec2unit</a></tt><tt class="py-op">[</tt><tt class="py-string">'days'</tt><tt class="py-op">]</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">asarray</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-string">'float64'</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">fac</tt> </tt>
</div><a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">     </tt>
<a name="time.get_jd"></a><div id="time.get_jd-def"><a name="L170"></a><tt class="py-lineno">170</tt> <a class="py-toggle" href="#" id="time.get_jd-toggle" onclick="return toggle('time.get_jd');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_jd">get_jd</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_jd-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_jd-expanded"><a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-name">utime</tt> <tt class="py-op">=</tt> <tt class="py-name">netcdftime</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">(</tt><tt class="py-string">'days since 0001-01-01 00:00:00'</tt><tt class="py-op">,</tt> \ </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">                                 <tt class="py-name">calendar</tt><tt class="py-op">=</tt><tt class="py-string">'proleptic_gregorian'</tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">date2num</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="octant.cf.time.dates
octant.ocean.time.time.dates" class="py-name" href="#" onclick="return doclink('link-23', 'dates', 'link-8');">dates</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"> </tt>
<a name="time.get_dates"></a><div id="time.get_dates-def"><a name="L175"></a><tt class="py-lineno">175</tt> <a class="py-toggle" href="#" id="time.get_dates-toggle" onclick="return toggle('time.get_dates');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="octant.cf.time-class.html#get_dates">get_dates</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time.get_dates-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="time.get_dates-expanded"><a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">np</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">utime</tt><tt class="py-op">.</tt><tt class="py-name">num2date</tt><tt class="py-op">(</tt><tt class="py-name">tval</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">tval</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">         </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">    <tt id="link-24" class="py-name" targets="Variable octant.cf.time.jd=octant.cf.time-class.html#jd,Variable octant.ocean.time.time.jd=octant.ocean.time.time-class.html#jd"><a title="octant.cf.time.jd
octant.ocean.time.time.jd" class="py-name" href="#" onclick="return doclink('link-24', 'jd', 'link-24');">jd</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name" targets="Method octant.cf.time.get_jd()=octant.cf.time-class.html#get_jd,Method octant.ocean.time.time.get_jd()=octant.ocean.time.time-class.html#get_jd"><a title="octant.cf.time.get_jd
octant.ocean.time.time.get_jd" class="py-name" href="#" onclick="return doclink('link-25', 'get_jd', 'link-25');">get_jd</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"Julian day, for plotting in pylab"</tt><tt class="py-op">)</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">    <tt id="link-26" class="py-name" targets="Variable octant.cf.time.seconds=octant.cf.time-class.html#seconds,Variable octant.ocean.time.time.seconds=octant.ocean.time.time-class.html#seconds"><a title="octant.cf.time.seconds
octant.ocean.time.time.seconds" class="py-name" href="#" onclick="return doclink('link-26', 'seconds', 'link-26');">seconds</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-27" class="py-name" targets="Method octant.cf.time.get_seconds()=octant.cf.time-class.html#get_seconds,Method octant.ocean.time.time.get_seconds()=octant.ocean.time.time-class.html#get_seconds"><a title="octant.cf.time.get_seconds
octant.ocean.time.time.get_seconds" class="py-name" href="#" onclick="return doclink('link-27', 'get_seconds', 'link-27');">get_seconds</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"seconds"</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">    <tt id="link-28" class="py-name" targets="Variable octant.cf.time.minutes=octant.cf.time-class.html#minutes,Variable octant.ocean.time.time.minutes=octant.ocean.time.time-class.html#minutes"><a title="octant.cf.time.minutes
octant.ocean.time.time.minutes" class="py-name" href="#" onclick="return doclink('link-28', 'minutes', 'link-28');">minutes</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-29" class="py-name" targets="Method octant.cf.time.get_minutes()=octant.cf.time-class.html#get_minutes,Method octant.ocean.time.time.get_minutes()=octant.ocean.time.time-class.html#get_minutes"><a title="octant.cf.time.get_minutes
octant.ocean.time.time.get_minutes" class="py-name" href="#" onclick="return doclink('link-29', 'get_minutes', 'link-29');">get_minutes</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"minutes"</tt><tt class="py-op">)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">    <tt id="link-30" class="py-name" targets="Variable octant.cf.time.hours=octant.cf.time-class.html#hours,Variable octant.ocean.time.time.hours=octant.ocean.time.time-class.html#hours"><a title="octant.cf.time.hours
octant.ocean.time.time.hours" class="py-name" href="#" onclick="return doclink('link-30', 'hours', 'link-30');">hours</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-31" class="py-name" targets="Method octant.cf.time.get_hours()=octant.cf.time-class.html#get_hours,Method octant.ocean.time.time.get_hours()=octant.ocean.time.time-class.html#get_hours"><a title="octant.cf.time.get_hours
octant.ocean.time.time.get_hours" class="py-name" href="#" onclick="return doclink('link-31', 'get_hours', 'link-31');">get_hours</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"hours"</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">    <tt id="link-32" class="py-name" targets="Variable octant.cf.time.days=octant.cf.time-class.html#days,Variable octant.ocean.time.time.days=octant.ocean.time.time-class.html#days"><a title="octant.cf.time.days
octant.ocean.time.time.days" class="py-name" href="#" onclick="return doclink('link-32', 'days', 'link-32');">days</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-33" class="py-name" targets="Method octant.cf.time.get_days()=octant.cf.time-class.html#get_days,Method octant.ocean.time.time.get_days()=octant.ocean.time.time-class.html#get_days"><a title="octant.cf.time.get_days
octant.ocean.time.time.get_days" class="py-name" href="#" onclick="return doclink('link-33', 'get_days', 'link-33');">get_days</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"days"</tt><tt class="py-op">)</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">    <tt id="link-34" class="py-name"><a title="octant.cf.time.dates
octant.ocean.time.time.dates" class="py-name" href="#" onclick="return doclink('link-34', 'dates', 'link-8');">dates</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-35" class="py-name" targets="Method octant.cf.time.get_dates()=octant.cf.time-class.html#get_dates,Method octant.ocean.time.time.get_dates()=octant.ocean.time.time-class.html#get_dates"><a title="octant.cf.time.get_dates
octant.ocean.time.time.get_dates" class="py-name" href="#" onclick="return doclink('link-35', 'get_dates', 'link-35');">get_dates</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"datetime objects"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt id="link-36" class="py-name"><a title="octant" class="py-name" href="#" onclick="return doclink('link-36', 'octant', 'link-0');">octant</a></tt><tt class="py-op">.</tt><tt id="link-37" class="py-name" targets="Module octant.sw.test=octant.sw.test-module.html"><a title="octant.sw.test" class="py-name" href="#" onclick="return doclink('link-37', 'test', 'link-37');">test</a></tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">    <tt id="link-38" class="py-name"><a title="octant" class="py-name" href="#" onclick="return doclink('link-38', 'octant', 'link-0');">octant</a></tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="octant.sw.test" class="py-name" href="#" onclick="return doclink('link-39', 'test', 'link-37');">test</a></tt><tt class="py-op">.</tt><tt class="py-name">cf_test</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Apr 20 11:56:32 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
